const webpack = require('webpack'); // 引入webpack
const path = require('path'); // 引入webpack中path方法

module.exports = {
  entry: "./src/index.tsx",
  output: {
    publicPath: '/',
    path: 'dist', // 本地打包文件存放的地方
    filename: '[name].js' //打包成的文件名
  },
  
  devtool: "source-map",
  resolve: {
    extensions: ["", ".ts", ".tsx", ".js"]
  },
  module: {
    loaders: [
      {
        test: /\.tsx?$/,
        loader: 'ts-loader'
      }
    ],
    preLoaders: [
      { test: /\.js$/, loader: "source-map-loader" }
    ]
  },
  externals: {
        "react": "React",
        "react-dom": "ReactDOM"
    },
}